package com.ruoyi.pcommerce.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pcommerce.mapper.PositionCommerceMapper;
import com.ruoyi.pcommerce.domain.PositionCommerce;
import com.ruoyi.pcommerce.service.IPositionCommerceService;

/**
 * 帮养之家位置信息Service业务层处理
 * 
 * @author zhezhi
 * @date 2022-10-02
 */
@Service
public class PositionCommerceServiceImpl implements IPositionCommerceService 
{
    @Autowired
    private PositionCommerceMapper positionCommerceMapper;

    /**
     * 查询帮养之家位置信息
     * 
     * @param commerceId 帮养之家位置信息主键
     * @return 帮养之家位置信息
     */
    @Override
    public PositionCommerce selectPositionCommerceByCommerceId(Long commerceId)
    {
        return positionCommerceMapper.selectPositionCommerceByCommerceId(commerceId);
    }

    /**
     * 查询帮养之家位置信息列表
     * 
     * @param positionCommerce 帮养之家位置信息
     * @return 帮养之家位置信息
     */
    @Override
    public List<PositionCommerce> selectPositionCommerceList(PositionCommerce positionCommerce)
    {
        return positionCommerceMapper.selectPositionCommerceList(positionCommerce);
    }

    /**
     * 新增帮养之家位置信息
     * 
     * @param positionCommerce 帮养之家位置信息
     * @return 结果
     */
    @Override
    public int insertPositionCommerce(PositionCommerce positionCommerce)
    {
        positionCommerce.setCreateTime(DateUtils.getNowDate());
        return positionCommerceMapper.insertPositionCommerce(positionCommerce);
    }

    /**
     * 修改帮养之家位置信息
     * 
     * @param positionCommerce 帮养之家位置信息
     * @return 结果
     */
    @Override
    public int updatePositionCommerce(PositionCommerce positionCommerce)
    {
        positionCommerce.setUpdateTime(DateUtils.getNowDate());
        return positionCommerceMapper.updatePositionCommerce(positionCommerce);
    }

    /**
     * 批量删除帮养之家位置信息
     * 
     * @param commerceIds 需要删除的帮养之家位置信息主键
     * @return 结果
     */
    @Override
    public int deletePositionCommerceByCommerceIds(Long[] commerceIds)
    {
        return positionCommerceMapper.deletePositionCommerceByCommerceIds(commerceIds);
    }

    /**
     * 删除帮养之家位置信息信息
     * 
     * @param commerceId 帮养之家位置信息主键
     * @return 结果
     */
    @Override
    public int deletePositionCommerceByCommerceId(Long commerceId)
    {
        return positionCommerceMapper.deletePositionCommerceByCommerceId(commerceId);
    }
}
